<!--{template common/header_simple_start}-->
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
<link href="admin/thame/images/style.css?{VERHASH}" rel="stylesheet" media="all">
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
<style>
	html,
	body {
		overflow: hidden;
		background: #FBFBFB;
	}
	
	.bs-left-container {
		width: 120px;
	}
	
	.bs-main-container {
		margin-left: 120px;
		overflow: auto;
	}
</style>
<!--{template common/header_simple_end}-->

<div class="bs-container clearfix">
	<div class="bs-left-container  clearfix">
		<!--{template left}-->
	</div>
	<div class="left-drager">
		<div class="left-drager-op">
			<div class="left-drager-sub"></div>
		</div>
	</div>

	<div class="bs-main-container  clearfix">

		<div class="main-header clearfix">
			<ul class="nav nav-pills nav-pills-bottomguide">
				<li>
					<a href="{BASESCRIPT}?mod=$mod">{lang all_theme}</a>
				</li>

				<!--{if !$id}-->
				<li class="active pull-right">
					<a href="{BASESCRIPT}?mod=$mod&op=edit">{lang add_theme}</a>
				</li>
				<!--{/if}-->
				<!--{if $id}-->
				<li class="active">
					<a href="{BASESCRIPT}?mod=$mod&op=edit&id=$id">{lang edit_theme}</a>
				</li>
				<!--{/if}-->
				<li>
					<a href="{ADMINSCRIPT}?mod=$mod&op=list">{lang uninstalled_theme}</a>
				</li>
			</ul>
		</div>

		<div class="main-content clearfix" style="padding:15px 0 0;border-top:1px solid #FFF">
			<form name="cpform" class="form-horizontal form-horizontal-left" method="post" action="{BASESCRIPT}?mod=thame&op=edit&id=$id" id="cpform" onsubmit="return  validate(this)">
				<input type="hidden" name="formhash" value="{FORMHASH}">
				<input type="hidden" name="thamesubmit" value="true">
				<div class="form-group">
					<label class="control-label" for="name">{lang theme_name}</label>
					<div class="controls">
						<input name="thame[name]" id="name" value="$thame[name]" type="text" class="form-control" required="true" onblur="if(this.value==''){jQuery(this).addClass('input-error')}else{jQuery(this).removeClass('input-error');}"> &nbsp;&nbsp;
						<label class="checkbox-inline "><input type="checkbox" name="thame[default]" value="1" <!--{if $thame[default]>0}-->checked="checked"<!--{/if}-->>{lang set_default}</label>
					</div>
					<ul class="help-block">
						{lang theme_edit_theme_name_state}
					</ul>
				</div>
				<div class="form-group">
					<label class="control-label" for="">{lang version}</label>
					<div class="controls">
						<input name="thame[version]" class="form-control" value="$thame[version]" type="text" />
					</div>
					<span class="help-inline">{lang theme_edit_version_state}</span>
				</div>
				<div class="form-group">
					<label class="control-label" for="">{lang supplier}</label>
					<div class="controls">
						<input name="thame[vendor]" class="form-control" value="$thame[vendor]" type="text" />
					</div>
					<span class="help-inline">{lang theme_edit_supplier_state}</span>
				</div>
				<div class="form-group">
					<label class="control-label" for="">{lang img_background}</label>
					<div class="controls">
						<input name="thame[backimg]" class="form-control" value="$thame[backimg]" type="text" />
					</div>
					<ul class="help-block">
						{lang theme_edit_img_background_state}
					</ul>
				</div>
				<div class="form-group">
					<label class="control-label" for="">{lang web_background}</label>
					<div class="controls">
						<input name="thame[url]" class="form-control" value="$thame[url]" type="text" />
					</div>
					<ul class="help-block">
						{lang theme_edit_web_background}
					</ul>
				</div>
				<div class="form-group">
					<label class="control-label" for="">{lang background_display_mode}</label>
					<div class="controls  ml20">
						<label class="radio radio-inline"><input type="radio" name="thame[btype]" value="1"  <!--{if $thame[btype]==1 || !$thame[btype]}-->checked<!--{/if}--> />{lang stretch}</label>
						<label class="radio radio-inline"><input type="radio" name="thame[btype]" value="2" <!--{if $thame[btype]==2}-->checked<!--{/if}--> />{lang tiled}</label>
						<label class="radio radio-inline"><input type="radio" name="thame[btype]" value="3" <!--{if $thame[btype]==3}-->checked<!--{/if}--> />{lang between}</label>
					</div>
					<ul class="help-block">{lang theme_edit_background_display_mode}</ul>
				</div>
				<div class="form-group">
					<label class="control-label" for="">{lang preference_color_set}</label>
					<div class="controls ml20">
						<label class="radio radio-inline"><input type="radio" name="thame[enable_color]" value="0" <!--{if $thame[enable_color]<1}-->checked<!--{/if}--> onclick="jQuery('#enable_color').hide()" />{lang none}</label>
						<label class="radio radio-inline"><input type="radio" name="thame[enable_color]" value="1" <!--{if $thame[enable_color]>0}-->checked<!--{/if}--> onclick="jQuery('#enable_color').show()" />{lang have}</label>
					</div>
					<div id="enable_color" class="clearfix ml20" style="padding-left:20px; <!--{if $thame[enable_color]>0}-->display:block<!--{else}-->display:none<!--{/if}-->">
						<label class="control-label">{lang default_preference_color}：</label>
						<input type="text" class="form-control" style="width:80px;" name="thame[color]" value="$thame[color]" />
					</div>
					<ul class="help-block">
						{lang theme_edit_preference_color_set}
					</ul>
				</div>
				<div class="form-group">
					<label class="control-label" for="folder">{lang theme_catalogue}</label>
					<div class="controls">
						<select id="folder" name="thame[folder]" class="form-control" required="true">
							<!--{loop $folders $value}-->
							<option value="$value" <!--{if $thame[folder]==$value}-->selected="selected"<!--{/if}-->>$value</option>
							<!--{/loop}-->
						</select>
					</div>
					<ul class="help-block">
						{lang theme_edit_theme_catalogue_state}
					</ul>
				</div>

				<!--{loop $thameitems $key $value}-->
				<div class="form-group">
					<label class="control-label" for="$value">$styles[$key]</label>
					<div class="controls">
						<select id="$key" name="thame[modules][$key]" class="form-control">
							<option value="">{lang none}</option>
							<!--{loop $value $value1}-->
							<option value="$value1" <!--{if $thame[modules][$key]==$value1}-->selected="selected"<!--{/if}-->>$value1</option>
							<!--{/loop}-->
						</select>
					</div>
					<ul class="help-block">
						{lang theme_edit_common_windon}
					</ul>
				</div>
				<!--{/loop}-->
				<div class="form-group">
					<label class="control-label"></label>
					<div class="controls">
						<input type="submit" value="{lang save_changes}" class="btn btn-primary" />
					</div>
				</div>
			</form>
			<div class="tip" style="margin:10px;">
				<div class="alert alert-warning">
					<button type="button" class="close" data-dismiss="alert"></button>
					<h5>{lang board_message}</h5>
					<ul>
						{lang theme_edit_board_message_state}
					</ul>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	jQuery('.left-drager').leftDrager_layout();

	function validate(form) {
		if(document.getElementById('name').value == '') {
			document.getElementById('name').focus();
			showmessage('{lang please_fill_topic_name}', 'danger', 1000, 1);
			return false;
		}
		if(document.getElementById('folder').value == '') {
			document.getElementById('folder').focus();
			showmessage('{lang theme_edit_no_subject_catalog}', 'danger', 3000, 1);
			return false;
		}
		return true;
	}
</script>
<!--{template common/footer_simple}-->